<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<h3>Sisesta üks number 1-1000-ni</h1>

<?php
//Tiina Võsumägi phpkursus1109 14.11
$loe++;
$number = $_POST['number'];
$arva_ara = $_POST['arva_ara'];
$loe = $_POST['loe'];
if (!isset($number))
{
  $number = rand(0,1000);
}
if ($_POST['number'] == $arva_ara)
{
  echo "Õige! Sa arvasid ära $loe korraga";
}else if ($_POST['arva_ara'] > $number)
  {
    echo "See number on väiksem";
    $loe++;
  }else if ($_POST['arva_ara'] < $number)
    {
      echo "See number on suurem";
      $loe++;
    }

?>
<form action="<?php $_SERVER['PHP_SELF']?>" method="post">
<input type="hidden" name="number" value="<?php echo($number); ?>">
<input type="hidden" name="loe" value="<?php echo($loe); ?>">
<input type="text" name="arva_ara" value="<?php echo($arva_ara); ?>">
<input type="submit" value="Paku">
</form>
